Skip to content

fix(android): keep a ripple foreground with the border drawn over the children - #18

Merged
farfromrefug merged 1 commit into
mainfrom
fix/border-foreground-with-ripple
Nov 16, 2026
Merged

farfromrefug merged 1 commit into
mainfrom
fix/border-foreground-with-ripple

Conversation

@farfromrefug

Copy link
Copy Markdown

What is the current behavior?

Since #17 a view with a border radius and a border width draws its border as the view foreground, over the children. The ui-core plugin draws rippleColor as the same single foreground (view.setForeground(rippleDrawable)), so whichever runs last wins: a view with a border, a radius and a ripple loses its border (e.g. alpimaps bottom-sheet round action buttons, lens pills). Removing the border also called setForeground(null), which cleared the ripple.

What is the new behavior?

View._updateForeground() sets the foreground from nativeView._borderForeground and nativeView._rippleForeground. With both, they go in a LayerDrawable with the border over the ripple. The border code goes through it instead of calling setForeground. The ripple owner (ui-core) sets _rippleForeground and calls it: nativescript-community/ui-native-components, same-named fix branch. Without that plugin change nothing changes.

Manual test (native Android drawing, no unit test): a GridLayout with borderRadius, borderWidth and rippleColor: the border stays and the ripple shows under it on press. Not run yet.

🤖 Generated with Claude Code

… children

The border drawn over the children and a ripple (set by the ui-core plugin)
both used the single view foreground, so one erased the other: a view with a
border radius, a border width and a ripple lost its border. Removing the
border also cleared the ripple.

The foreground is now set by View._updateForeground(), from the border
(_borderForeground) and the ripple (_rippleForeground): both go in a
LayerDrawable, the border over the ripple.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@farfromrefug
farfromrefug marked this pull request as ready for review November 16, 2026 16:13
@farfromrefug
farfromrefug merged commit 848ffe3 into main Nov 16, 2026
0 of 2 checks passed
@farfromrefug
farfromrefug deleted the fix/border-foreground-with-ripple branch November 16, 2026 16:13
weblate pushed a commit to weblate/alpimaps that referenced this pull request Nov 18, 2026
typings: the typed lookAhead of the SDK. ui-core: the ripple/border foreground fix
(nativescript-community/ui-native-components#28, with Akylas/NativeScript#18). Drop the
ui-core portal once it is released.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant